<html>
<head>

    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">

    <title>My Nest</title>

    <link rel="stylesheet" href="static/css/font-awesome.min.css">

    <link rel="stylesheet prefetch" href="static/css/bootstrap3.0.0.min.css">

    <link rel="stylesheet" href="static/css/style.css" media="screen" type="text/css">
    <script type="text/javascript" src="static/jquery-3.2.1.min.js"></script>
    <script type="text/javascript">
        $(function () {
            $("#login").click(function () {
                var account = $("#username").val();
                var password = $("#password").val();
                $.get("/login/" + account + "/" + password, function (result) {
                    if (result.success) {
                        location.href = result.url;
                    } else {
                        $(".form-login-error").addClass("visible")
                    }
                });
            });
        });
    </script>
</head>

<body class="login-page">

<div class="login-form">

    <div class="login-content">

        <div class="form-login-error ">
            <h3>登录失败</h3>
            <p>账号或密码错误！</p>
        </div>


        <div class="form-group">

            <div class="input-group">
                <div class="input-group-addon">
                    <i class="fa fa-user"></i>
                </div>

                <input type="text" class="form-control" name="username" id="username" placeholder="账号"
                       autocomplete="off">
            </div>

        </div>

        <div class="form-group">

            <div class="input-group">
                <div class="input-group-addon">
                    <i class="fa fa-key"></i>
                </div>

                <input type="password" class="form-control" name="password" id="password" placeholder="密码"
                       autocomplete="off">
            </div>

        </div>

        <div class="form-group">
            <button id="login" type="button" class="btn btn-primary btn-block btn-login">
                <i class="fa fa-sign-in"></i>
                登 录
            </button>
        </div>
    </div>
</div>


</body>
</html>